package com.hkpickup.jdo;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.appengine.demos.jdoexamples.GuestbookUtils;

public class WebSiteServlet extends HttpServlet {

	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		boolean enable = false;
		if (req.getParameter("enable").equals("1")){
			enable = true;
		}
	    WebSiteUtils.insert(req.getParameter("url"), enable);
	    resp.sendRedirect("/WebSite.jsp");
	}
	
}
